package com.shenyue.nbtownlet.model;

import android.content.Context;

import com.alibaba.fastjson.JSONObject;
import com.shenyue.nbtownlet.event.BaseListener;

/**
 * 巡查任务
 */

public class AppInsertTaskModel {
    private static final String ROOT = "SmallTown/XCZStreetScape";
    private static final String ROOT_DATA = "$smalltown_xczstreetscape_data$";

    /***获取任务类型接口****/
    private static final String GETASSESSTYPE = "getAssessType";
    public static final String GETASSESSTYPE_ACTION = "$getassesstype_action$";
    /***获取任务类型接口****/
    private static final String GETASSESSTASKBYTYPE = "getAssessTaskByType";
    public static final String GETASSESSTASKBYTYPE_ACTION = "$getassesstaskbytype_action$";
    /***获取任务类型接口****/
    private static final String GETASSESSMENTBYTASKID = "getAssessMentBYTaskID";
    public static final String GETASSESSMENTBYTASKID_ACTION = "$getassessmentbytaskid_action$";

    /***巡查任务表单提交接口****/
    private static final String INSERTSSDATA = "InsertSSData";
    public static final String INSERTSSDATA_ACTION = "$insertssdata_action$";

    /***待办详情表单提交（日常巡查****/
    private static final String UPDATESSDATA = "UpdateSSData";
    public static final String UPDATESSDATA_ACTION = "$updatessdata_action$";

    /***待办，已办任务详情获取接口（日常巡查）****/
    private static final String GETDETAILWORKBYID = "getDetailWorkByID";
    public static final String GETDETAILWORKBYID_ACTION = "$getdetailworkbyid_action$";

    /***更改任务流程状态接口****/
    private static final String SMALLTOWN_XCZSTREETSCAPE_CHANGEFORMSTATUS = "smalltown/XCZstreetscape/getchangeformstatus";
    public static final String SMALLTOWN_XCZSTREETSCAPE_CHANGEFORMSTATUS_ACTION = "$smalltown_xczstreetscape_changeformstatus_action$";

    /***获取暂存列表接口****/
    private static final String SMALLTOWN_XCZSTREETSCAPE_GETASSESSMENTWORKS = "smalltown/XCZstreetscape/getAssessMentWorks";
    public static final String SMALLTOWN_XCZSTREETSCAPE_GETASSESSMENTWORKS_ACTION = "$smalltown_xczstreetscape_getassessmentworks_action$";

    /***获取暂存列表接口****/
    private static final String SMALLTOWN_XCZSTREETSCAPE_GETWORKSDATABYIDENID = "smalltown/XCZstreetscape/getWorksDataByidenid";
    public static final String SMALLTOWN_XCZSTREETSCAPE_GETWORKSDATABYIDENID_ACTION = "$SMALLTOWN_XCZSTREETSCAPE_GETWORKSDATABYIDENID_ACTION$";

    /***待办、已办任务收文分发详情表单获取接口****/
    private static final String GETACCEPTARCHIVES = "SmallTown/AcceptArchives/GetAcceptArchives";
    public static final String GETACCEPTARCHIVES_ACTION = "$getacceptarchives_action$";

    /***字检表接口****/
    private static final String GETSENDARCHIVESDICTIONARY = "SmallTown/SendArchives/GetSendArchivesDictionary";
    public static final String GETSENDARCHIVESDICTIONARY_ACTION = "$getsendarchivesdictionary_action$";

    /***信息报送详情接口****/
    private static final String GETNEWSBYID = "Smalltown/XCZNewsManage/GetNewsById";
    public static final String GETNEWSBYID_ACTION = "$getnewsbyid_action$";

    public static void GetAssessType(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + ROOT + "/" + GETASSESSTYPE, GETASSESSTYPE_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void GetAssessTaskByType(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + ROOT + "/" + GETASSESSTASKBYTYPE, GETASSESSTASKBYTYPE_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void GetAssessMentBYTaskID(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + ROOT + "/" + GETASSESSMENTBYTASKID, GETASSESSMENTBYTASKID_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void InsertssData(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().post(AppModel.kBaseURL + "/" + ROOT + "/" + INSERTSSDATA, INSERTSSDATA_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void UpdatessData(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().post(AppModel.kBaseURL + "/" + ROOT + "/" + UPDATESSDATA, UPDATESSDATA_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void getDetailWorkByID(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + ROOT + "/" + GETDETAILWORKBYID, GETDETAILWORKBYID_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void Getchangeformstatus(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + SMALLTOWN_XCZSTREETSCAPE_CHANGEFORMSTATUS, SMALLTOWN_XCZSTREETSCAPE_CHANGEFORMSTATUS_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void GetAssessMentWorks(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + SMALLTOWN_XCZSTREETSCAPE_GETASSESSMENTWORKS, SMALLTOWN_XCZSTREETSCAPE_GETASSESSMENTWORKS_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void GetWorksDataByidenid(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + SMALLTOWN_XCZSTREETSCAPE_GETWORKSDATABYIDENID, SMALLTOWN_XCZSTREETSCAPE_GETWORKSDATABYIDENID_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void GetAcceptArchives(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + GETACCEPTARCHIVES, GETACCEPTARCHIVES_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void GetNewsById(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + GETNEWSBYID, GETNEWSBYID_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }

    public static void GetSendArchivesDictionary(final Context context, JSONObject param, final BaseListener listener) {
        HttpClientExManager.instance().get(AppModel.kBaseURL + "/" + GETSENDARCHIVESDICTIONARY, GETSENDARCHIVESDICTIONARY_ACTION, param, new BaseListener() {
            @Override
            public void success(String val, String action) {
                if (listener != null)
                    listener.success(val, action);
            }

            @Override
            public void error(String error, String action) {
                if (listener != null)
                    listener.error(error, action);
            }
        });
    }
}
